package com.wxx.design.composite;

/**
 * @author Jetwang
 * @version 1.0
 * @date 2022/4/21 20:45
 */
public class Test {
    public static void main(String[] args) {
        // 课程
        CatalogComponent linuxCourse = new Course("Linux课程", 11);
        CatalogComponent windowsCourse = new Course("windows课程", 12);

        // 目录
        CatalogComponent javaCourseCatalog = new CourseCatalog("Java Course Catalog");

        // 电商课程
        CatalogComponent mallCourse01 = new Course("Java电商第一季", 199);
        CatalogComponent mallCourse02 = new Course("Java电商第二季", 299);
        CatalogComponent designPattern = new Course("Java设计模式", 268);

        javaCourseCatalog.add(mallCourse01);
        javaCourseCatalog.add(mallCourse02);
        javaCourseCatalog.add(designPattern);

        // 课程主目录
        CatalogComponent mainCourseCatalog = new CourseCatalog("Java Main Catalog");
        mainCourseCatalog.add(linuxCourse);
        mainCourseCatalog.add(windowsCourse);
        mainCourseCatalog.add(javaCourseCatalog);

        mainCourseCatalog.Print();


    }
}
